home *** CD-ROM | disk | FTP | other *** search
/ Freelog 125 / Freelog_MarsAvril2015_No125.iso / Musique / Quod Libet / quodlibet-3.3.0-installer.exe / bin / __future__.pyc (.txt) next >
Python Compiled Bytecode  |  2014-12-31  |  4KB  |  106 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.7)
  3.  
  4. '''Record of phased-in incompatible language changes.
  5.  
  6. Each line is of the form:
  7.  
  8.     FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ","
  9.                               CompilerFlag ")"
  10.  
  11. where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples
  12. of the same form as sys.version_info:
  13.  
  14.     (PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int
  15.      PY_MINOR_VERSION, # the 1; an int
  16.      PY_MICRO_VERSION, # the 0; an int
  17.      PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string
  18.      PY_RELEASE_SERIAL # the 3; an int
  19.     )
  20.  
  21. OptionalRelease records the first release in which
  22.  
  23.     from __future__ import FeatureName
  24.  
  25. was accepted.
  26.  
  27. In the case of MandatoryReleases that have not yet occurred,
  28. MandatoryRelease predicts the release in which the feature will become part
  29. of the language.
  30.  
  31. Else MandatoryRelease records when the feature became part of the language;
  32. in releases at or after that, modules no longer need
  33.  
  34.     from __future__ import FeatureName
  35.  
  36. to use the feature in question, but may continue to use such imports.
  37.  
  38. MandatoryRelease may also be None, meaning that a planned feature got
  39. dropped.
  40.  
  41. Instances of class _Feature have two corresponding methods,
  42. .getOptionalRelease() and .getMandatoryRelease().
  43.  
  44. CompilerFlag is the (bitfield) flag that should be passed in the fourth
  45. argument to the builtin function compile() to enable the feature in
  46. dynamically compiled code.  This flag is stored in the .compiler_flag
  47. attribute on _Future instances.  These values must match the appropriate
  48. #defines of CO_xxx flags in Include/compile.h.
  49.  
  50. No feature line is ever to be deleted from this file.
  51. '''
  52. all_feature_names = [
  53.     'nested_scopes',
  54.     'generators',
  55.     'division',
  56.     'absolute_import',
  57.     'with_statement',
  58.     'print_function',
  59.     'unicode_literals']
  60. __all__ = [
  61.     'all_feature_names'] + all_feature_names
  62. CO_NESTED = 16
  63. CO_GENERATOR_ALLOWED = 0
  64. CO_FUTURE_DIVISION = 8192
  65. CO_FUTURE_ABSOLUTE_IMPORT = 16384
  66. CO_FUTURE_WITH_STATEMENT = 32768
  67. CO_FUTURE_PRINT_FUNCTION = 65536
  68. CO_FUTURE_UNICODE_LITERALS = 131072
  69.  
  70. class _Feature:
  71.     
  72.     def __init__(self, optionalRelease, mandatoryRelease, compiler_flag):
  73.         self.optional = optionalRelease
  74.         self.mandatory = mandatoryRelease
  75.         self.compiler_flag = compiler_flag
  76.  
  77.     
  78.     def getOptionalRelease(self):
  79.         '''Return first release in which this feature was recognized.
  80.  
  81.         This is a 5-tuple, of the same form as sys.version_info.
  82.         '''
  83.         return self.optional
  84.  
  85.     
  86.     def getMandatoryRelease(self):
  87.         '''Return release in which this feature will become mandatory.
  88.  
  89.         This is a 5-tuple, of the same form as sys.version_info, or, if
  90.         the feature was dropped, is None.
  91.         '''
  92.         return self.mandatory
  93.  
  94.     
  95.     def __repr__(self):
  96.         return '_Feature' + repr((self.optional, self.mandatory, self.compiler_flag))
  97.  
  98.  
  99. nested_scopes = _Feature((2, 1, 0, 'beta', 1), (2, 2, 0, 'alpha', 0), CO_NESTED)
  100. generators = _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), CO_GENERATOR_ALLOWED)
  101. division = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), CO_FUTURE_DIVISION)
  102. absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), CO_FUTURE_ABSOLUTE_IMPORT)
  103. with_statement = _Feature((2, 5, 0, 'alpha', 1), (2, 6, 0, 'alpha', 0), CO_FUTURE_WITH_STATEMENT)
  104. print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), CO_FUTURE_PRINT_FUNCTION)
  105. unicode_literals = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), CO_FUTURE_UNICODE_LITERALS)
  106.